//
//  TabBarView.m
//  quanminzhekou
//
//  Created by zxl on 15/1/6.
//  Copyright (c) 2015年 zhongqinglongtu. All rights reserved.
//

#import "TabBarView.h"

@implementation TabBarView

- (void)defulteStatus {
    [self onTapFirstBtn:self.firstBtn];
    self.isNaviRootControllerChange = NO;
}

#pragma mark - IBAction
- (IBAction)onTapFirstBtn:(id)sender {
    [self setBtnSelecte:sender];
    if (self.tapFirstBtnHandler) {
        self.tapFirstBtnHandler();
    }
}

- (IBAction)onTapSecondBtn:(id)sender {
    [self setBtnSelecte:sender];
    if (self.tapSecondBtnHandler) {
        self.tapSecondBtnHandler();
    }
}

- (IBAction)onTapThirdBtn:(id)sender {
    [self setBtnSelecte:sender];
    if (self.tapThirdBtnHandler) {
        self.tapThirdBtnHandler();
    }
}

- (IBAction)onTapFourthBtn:(id)sender {
    [self setBtnSelecte:sender];
    if (self.tapFourthBtnHandler) {
        self.tapFourthBtnHandler();
    }
}

#pragma mark - 
- (void)setBtnSelecte:(id)sender {
    UIButton* btn = (UIButton*)sender;
    self.isNaviRootControllerChange = !btn.selected;
    
    self.firstBtn.selected = NO;
    self.secondBtn.selected = NO;
    self.thirdBtn.selected = NO;
    self.fourthBtn.selected = NO;
    
    btn.selected = YES;
    
}

@end
